<?php get_header();
global $wpdb;
$tb = 'ap_painting_user' ;
$user = $wpdb->get_results("SELECT * FROM ap_painting_play ORDER BY score DESC, adddate DESC");
?>
<script type="text/javascript">
  $('.container').addClass('thele');
</script>

<div class="btn-menu-doc">
    <a href="<?php echo site_url() ?>"><img src="<?php echo bloginfo('template_url'); ?>/img/btn-trangchu.png"></a>
	<a href="<?php echo site_url() ?>/the-le"><img src="<?php echo bloginfo('template_url'); ?>/img/btn-thele.png"></a>
    <a href="javascript:;"><img src="<?php echo bloginfo('template_url'); ?>/img/btn-bangxephang-hover.png"></a>
	<a href="<?php echo site_url() ?>/play"><img src="<?php echo bloginfo('template_url'); ?>/img/btn-dapnieunao.png"></a>
</div>

<div class="title-bangxephang">
	<img src="<?php echo bloginfo('template_url'); ?>/img/txt-bangxephang.png">
	<img class="txt-table" src="<?php echo bloginfo('template_url'); ?>/img/txt-table.png">
</div>

<div class="content-bangxephang">
	<table>
        <?php $exist_user = array(); 
        foreach($user as $key=>$row){ 
            if(empty($row->username)||$row->score==0) continue; 
            if(in_array($row->cmnd, $exist_user)) continue;
            $exist_user[] = $row->cmnd;
        ?>
		<tr>
			<td width="50" align="left">#<?php echo $key+1 ?></td>
			<td width="240" align="left"><?php echo $row->username ?></td>
			<td width="50" align="right"><?php echo $row->score ?></td>
		</tr>
		<?php } ?>
	</table>
</div>

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('.content-bangxephang').slimscroll({
            width: '450px',
            height: '290px',
            railVisible: true,
            alwaysVisible: true,
            railColor: '#ffffff',
            opacity: 1,
            color: '#c5003d'
        });
    });
</script>

<?php get_footer() ?>